import request from '@/utils/request'

export default {
  login(data) {
    return request({
      url: '/user/login',
      method: 'post',
      data
    })
  },
  getInfo() {
    return request({
      url: '/user/info',
      method: 'get'
    })
  },
  logout() {
    return request({
      url: '/vue-admin-template/user/logout',
      method: 'post'
    })
  },
  addUser(data) {
    return request({
      url: '/rbac/user/add',
      method: 'post',
      data
    })
  },
  deleteUser(id) {
    return request({
      url: '/rbac/user/delete',
      method: 'post',
      params:{id}
    })
  },
  selectUserList(pagination) {
    return request({
      url: "/rbac/user/list",
      method: "get",
      params: pagination
    })
  },
  selectUserById(id) {
    return request({
      url: "/rbac/user/selectById",
      method: "get",
      params: {id}
    })
  },
  updateUser(data) {
    return request({
      url: "/rbac/user/update",
      method: "post",
      data
    })
  }
}
